<%@page pageEncoding="utf-8" contentType="text/html; charset=utf-8" %>
<%@ include file="/cms/include/init_admin.jsp" %>
<%@ page import="com.qbooks.cms.admin.*" %>
<%
	HashList code015	= CommonUtil.getCodeList("015");	//판매자구분
	HashList code016	= CommonUtil.getCodeList("016");	//은행
	HashList codeUseYn	= CommonUtil.getCodeList("use_yn");	//

	String job_type		= StringUtil.nvl(request.getParameter("job_type"),"U");
	String publisher_id	= StringUtil.nvl(request.getParameter("publisher_id"));

	HashMap infos 		= new HashMap();
	infos.put("publisher_id",	publisher_id);

	AdminDAO dao 		= new AdminDAO();
	HashList list 		= dao.selectPublisherList(infos);


%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
	<title><%= SYSTEM_NAME %></title>
	<%@ include file="/cms/include/cssnjs.jsp"  %>
	<script type="text/javascript" src="/js/ajaxfileupload.js"></script>
	<script type="text/javascript" src="/SE2.3.1.O9858/js/HuskyEZCreator.js" charset="utf-8"></script>

	<script type="text/javascript">
	var oEditors = [];

	$(document).ready(function() {

		/* 탭 클릭 */
		$('li', '#tabs').click(function(){
		    $('.on', '#tabs').removeClass('on').addClass('off');
		    $(this).addClass('on');

			$('#tabs-1:not(.hidden),#tabs-2:not(.hidden),#tabs-3:not(.hidden)').addClass('hidden');
			$('#tabs-'+$(this).attr('code')).removeClass('hidden');
		});

		$('#list').find('input').change(function() {
			$(this).closest('tr').find('input[name="list.job_type"]').val('U');
		});

	});


	function fnSave() {
		if (confirm(MSG_<%=job_type%>)) {
			$('#saveForm').attr('action', './publisherSave.do');
			$('#saveForm').submit();
		}
	}


	function fnDelete() {
		if (confirm(MSG_D)) {
			$('#job_type').val('D');
			$('#saveForm').attr('action', './publisherSave.do');
			$('#saveForm').submit();
		}
	}



	</script>
</head>
<body>
<div id="wrap">
	<div id="top">
		<%@ include file="/cms/include/top.jsp" %>
	</div>
	<div id="page">
		<div id="menu">
			<%@ include file="/cms/include/leftMenu.jsp" %>
		</div>
		<div id="contents">
			<div class="menu_title">
				<h1>발행자관리</h1>
				<p>CMS > 관리자  > <b>발행자관리</b></p>
			</div>
			<div class="clear line_01"></div>

			<ul id="tabs" class="tab_01 mt15">
			    <li class="on"  code="1"><p>1. 기본사항</p></li>
		<%	if ("U".equals(job_type)) { %>
			    <li class="off" code="2"><p>2. 큐북목록</p></li>
			    <li class="off" code="3"><p>3. 판매내역</p></li>
		<%	} %>
			</ul>

			<div id="tabs-1" class="mt15">
				<form id="saveForm" method="post" action="">
				<input type="hidden" name="job_type" id="job_type" value="<%= job_type %>"/>

				<table cellpadding="0" cellspacing="0" class="table_01 mt5">
				<colgroup>
					<col width="100px"/>
					<col width="300px"/>
					<col width="100px"/>
					<col/>
				</colgroup>
				<tbody>
					<tr>
						<th><p>아이디</p></th>
						<td colspan="3" class="brx">
							<input type="text" name="publisher_id" value="<%= list.get("publisher_id", 0) %>" maxlength="12" class="w200"/>
							(영문소문자 또는 숫자, 2~12글자)
						</td>
					</tr>
					<tr>
						<th><p>비밀번호</p></th>
						<td colspan="3" class="brx">
		        			<input type="text" name="publisher_pw" value="<%= list.get("publisher_pw", 0) %>"  class="w200"/>
						</td>
					</tr>
					<tr>
						<th><p>사업자명</p></th>
						<td>
							<input type="text" name="publisher_name" value="<%= list.get("publisher_name", 0) %>" class="w200"/>
						</td>
						<th><p>사업자구분</p></th>
						<td>
		        			<%= StringUtil.makeRadio(code015, "biz_gubn", list.get("biz_gubn",0)) %>
						</td>
					</tr>
					<tr>
						<th><p>수수료율</p></th>
						<td>
		        			<input type="text" name="qbooks_rate" value="<%= list.get("qbooks_rate", 0) %>" class="w60 r"/> %
						</td>
						<th><p>계좌번호</p></th>
						<td  class="brx">
							<select name="bank_code">
		        			<%= StringUtil.makeOption(code016, list.get("bank_code",0)) %>
		        			</select>
		        			<input type="text" name="account_no" value="<%= list.get("account_no", 0) %>" class="w200"/>
						</td>
					</tr>
					<tr>
						<th><p>이메일</p></th>
						<td >
							<input type="text" name="email" value="<%= list.get("email", 0) %>"  class="w200"/>
						</td>
						<th><p>연락처</p></th>
						<td  class="brx">
							<input type="text" name="hp_no" value="<%= list.get("hp_no", 0) %>"  class="w200"/>
	        			</td>
					</tr>
					<tr>
						<th><p>등록일</p></th>
						<td>
							<%= list.get("init_date", 0) %>
						</td>
						<th><p>사용여부</p></th>
						<td class="brx">
							<%= StringUtil.makeRadio(codeUseYn, "use_yn", list.get("use_yn",0)) %>
						</td>
					</tr>
				</tbody>
				</table>

				<div class="search_result">출판사정보</div>
				<table cellpadding="0" cellspacing="0" class="table_01 mt5">
				<colgroup>
					<col width="100px"/>
					<col width="280px"/>
					<col width="100px"/>
					<col/>
				</colgroup>
				<tbody>
					<tr>
						<th><p>대표자명</p></th>
						<td colspan="3" class="brx">
							<input type="text" name="ceo_name" value="<%= list.get("ceo_name", 0) %>" class="w200"/>
						</td>
					</tr>
					<tr>
						<th><p>사업자번호</p></th>
						<td colspan="3" class="brx">
							<input type="text" name="biz_no" value="<%= list.get("biz_no", 0) %>"  class="w200"/>
						</td>
					</tr>
				</tbody>
				</table>

				<div class="mt20 mb10 c">
					<a href="./publisherList.jsp"><img src="../images/btn_list.gif"/></a>
			<%	if ("U".equals(job_type)) { %>
					<a href="#nohref" onclick="fnSave()"><img src="../images/btn_update.gif" /></a>
					<a href="#nohref" onclick="fnDelete()"><img src="../images/btn_delete.gif" /></a>
			<%	} else if ("C".equals(job_type)) { %>
					<a href="#nohref" onclick="fnSave()"><img src="../images/btn_register.gif" /></a>
			<%	} %>
				</div>

				</form>

			</div>





		</div>
	</div>
</div>

</body>
</html>
